﻿#include "alert.h"
#include "ui_alert.h"

alert::alert(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::alert)
{
    ui->setupUi(this);
    this->setWindowFlags(Qt::WindowStaysOnTopHint);
    this->setAttribute(Qt::WA_QuitOnClose, false);
    this->setWindowModality(Qt::ApplicationModal);
    mainMovie = new QMovie(":/pic/picture/hcdt.gif");
    ui->label->setMovie(mainMovie);
    mainMovie->start();
#ifdef Q_OS_ANDROID
    int fontId = QFontDatabase::addApplicationFont(":/FontStyle/AlibabaPuHuiTi-3-55-Regular.ttf");
    if (fontId != -1) {
        QStringList fontFamilies = QFontDatabase::applicationFontFamilies(fontId);
        if (!fontFamilies.isEmpty()) {
            QString familyName = fontFamilies.first();
            QFont font(familyName, 18); // 创建一个QFont对象，设置字体名称和默认大小

            // 使用setFont方法设置字体，传入QFont对象
            ui->label_2->setFont(font);
            ui->pushButton->setFont(font);
            ui->pushButton_2->setFont(font);

        }
    }
#endif
}

alert::~alert()
{
    delete ui;
}


void alert::on_pushButton_clicked()
{
    this->close();
}
